﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;

namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for ButtonTest and is intended
    ///to contain all ButtonTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ButtonTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Button Constructor
        ///</summary>
        [TestMethod()]
        public void ButtonConstructorTest() {
            Button target = new Button();
            Assert.AreEqual("<button></button>", target.ToString());
        }

        /// <summary>
        ///A test for AutoFocus
        ///</summary>
        [TestMethod()]
        public void AutoFocusTest() {
            Button target = new Button();
            bool expected = false;
            bool actual;
            target.AutoFocus = expected;
            actual = target.AutoFocus;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Disabled
        ///</summary>
        [TestMethod()]
        public void DisabledTest() {
            Button target = new Button();
            bool expected = false;
            bool actual;
            target.Disabled = expected;
            actual = target.Disabled;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Form
        ///</summary>
        [TestMethod()]
        public void FormTest() {
            Button target = new Button();
            Form expected = new Form();
            Form actual;
            target.Form = expected;
            actual = target.Form;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormAction
        ///</summary>
        [TestMethod()]
        public void FormActionTest() {
            Button target = new Button();
            string expected = string.Empty;
            string actual;
            target.FormAction = expected;
            actual = target.FormAction;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormEncType
        ///</summary>
        [TestMethod()]
        public void FormEncTypeTest() {
            Button target = new Button();
            string expected = string.Empty;
            string actual;
            target.FormEncType = expected;
            actual = target.FormEncType;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormMethod
        ///</summary>
        [TestMethod()]
        public void FormMethodTest() {
            Button target = new Button();
            Nullable<FormMethodChoices> expected = FormMethodChoices.GET;
            Nullable<FormMethodChoices> actual;
            target.FormMethod = expected;
            actual = target.FormMethod;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormNoValidate
        ///</summary>
        [TestMethod()]
        public void FormNoValidateTest() {
            Button target = new Button();
            bool expected = false;
            bool actual;
            target.FormNoValidate = expected;
            actual = target.FormNoValidate;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FormTarget
        ///</summary>
        [TestMethod()]
        public void FormTargetTest() {
            Button target = new Button();
            string expected = string.Empty;
            string actual;
            target.FormTarget = expected;
            actual = target.FormTarget;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            Button target = new Button();
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Type
        ///</summary>
        [TestMethod()]
        public void TypeTest() {
            Button target = new Button();
            Nullable<Button.ButtonType> expected = Button.ButtonType.Button;
            Nullable<Button.ButtonType> actual;
            target.Type = expected;
            actual = target.Type;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Value
        ///</summary>
        [TestMethod()]
        public void ValueTest() {
            Button target = new Button();
            string expected = string.Empty;
            string actual;
            target.Value = expected;
            actual = target.Value;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Button b = new Button();
            Form f = new Form();
            f.ID = "formid";
            b.AutoFocus = true;
            b.Disabled = true;
            b.Form = f;
            b.FormAction = "formaction";
            b.FormEncType = "formenctype";
            b.FormMethod = FormMethodChoices.GET;
            b.FormNoValidate = true;
            b.FormTarget = "target";
            b.Name = "name";
            b.Type = Button.ButtonType.Button;
            b.Value = "value";
            Assert.AreEqual("<button autofocus=\"autofocus\" " +
                "disabled=\"disabled\" " +
                "form=\"formid\" " +
                "formaction=\"formaction\" " +
                "formenctype=\"formenctype\" " +
                "formmethod=\"get\" " +
                "formnovalidate=\"formnovalidate\" " +
                "formtarget=\"target\" " +
                "name=\"name\" " +
                "type=\"button\" " +
                "value=\"value\"></button>", b.ToString());
        }
    }
}
